# Python 2.6.4
# Project Euler, Problem 102
# Copyright 2010 Talha Zaman

def isleft(p0, p1, p2):
    return (p1[0]-p0[0])*(p2[1]-p0[1]) - (p2[0]-p0[0])*(p1[1]-p0[1])

def contain(tri):
    t1 = isleft(tri[0], tri[1], (0, 0))
    t2 = isleft(tri[1], tri[2], (0, 0))
    t3 = isleft(tri[2], tri[0], (0, 0))
    return (t1<0 and t2<0 and t3<0) or (t1>0 and t2>0 and t3>0)

def triangle(data):
    c = [int(d) for d in data]
    return (c[0],c[1]), (c[2],c[3]), (c[4],c[5])

tris = [triangle(line.strip().split(',')) for line in open("triangles.txt").readlines()]
count = 0
for i in range(len(tris)):
    if contain(tris[i]): count += 1
print count
